<template>
	<view style="min-height: 100vh;" class="bg-color">
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-friendfamous text-brown">客户姓名</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.name}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-phone text-red">客户电话</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.tel}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-deliver text-yellow">车辆型号</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.carType}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-cuIcon text-green">车牌号码</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.carNumber}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-newshotfill text-purple">车架号码</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.vin}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-barcode text-mauve">卷轴编号</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.scrollNumber}}</text>
			</view>
		</view>
		<view class="cu-form-group align-start">
			<view class="title ">
				<text class="cuIcon-list text-pink">产品分类</text>
			</view>
			<view class="action text-gray padding-bottom">
				<view class="text-right padding-top" v-for="(item, index) in record.categorys" :key="index">
					{{item.name.replace("■", "").replace("■", "")}}
				</view>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-fork text-purple">产品型号</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.model}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-sponsorfill text-cyan">授权门店</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.distributorName}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-repairfill text-orange">施工日期</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.buildDate.split(" ")[0]}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-attentionfill text-red">质保到期</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.qaDate.split(" ")[0]}}</text>
			</view>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-rechargefill text-olive">价格</text>
			</view>
			<view class="action">
				<text class="text-grey">{{record.price}}</text>
			</view>
		</view>
		<view class="cu-form-group align-start">
			<view class="title cuIcon-form text-blue">备注</view>
			<textarea maxlength="-1" class="text-gray" v-model="record.des" placeholder="请输入备注"></textarea>
		</view>
		<view class="cu-form-group">
			<view class="content">
				<text class="title cuIcon-camerafill text-black">施工照片</text>
			</view>
		</view>
		<view class="cu-form-group flex-direction">
			<image mode="widthFix" class="margin-sm" v-for="(img, index) in image" :key="index" :src="'https://'+img.url"></image>
		</view>
		
	</view>
</template>

<script>
	export default {
		data: function() {
			return {
				record: {
					recordId: 1,
					name: "",
					tel: "",
					carType: "",
					carNumber: "",
					vin: "",
					distributorId: 1,
					distributorName: "",
					categorys: "",
					scrollNumber: "",
					buildDate: "",
					qaDate: "",
					price: 1123,
					des: "",
				},
				image: []
			};
		},
		onLoad:function(option){
			console.log(option.id);
			let self = this;
			this.http.get({
				url: "/record/info/"+option.id,
			}).then(function(res) {
				let categoryArray = JSON.parse(res.record.categorys);
				self.record = res.record;
				self.record.categorys = categoryArray;
				self.image = res.image;
			});
		},
		methods: {
			
		}
	}
</script>

<style>
</style>
